package com.link2room.rodimus.facade;

import com.link2room.common.enums.BaseSysExceptionEnum;
import com.link2room.common.exception.SysException;
import com.link2room.common.util.ExceptionUtil;
import com.link2room.soundwave.dto.param.inside.PmsReservationInsideParamDto;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * Created by LN on 2017/10/25
 */
public interface IAfterPMSdepDoFacadeService {
    ExecutorService exe = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
    void afterPMSDepDo(PmsReservationInsideParamDto pmsReservationInsideParamDto) throws Exception;

    default void syncAfterPMSDepDo(PmsReservationInsideParamDto pmsReservationInsideParamDto){
        exe.submit(() -> {
            try {
                this.afterPMSDepDo(pmsReservationInsideParamDto);
            } catch (Exception e) {
                e.printStackTrace();
                ExceptionUtil.getExceptionDetail(e);
                throw new SysException(BaseSysExceptionEnum.BASE_FUCATION_OPTION, e);
            }
        });
    }
}
